import axios from '@/api/fetch';
import SERVER from '@/api/server';
import * as types from "../auth/roleManage/types";

/**
 * 公司信息分页查询
 * @param params
 * @returns {*}
 */
export const getDealerCompanyByPage = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerCompany`, { params });

/**
 * 明细
 * @param companyId
 * @returns {*}
 */
export const getCompanyById = companyId => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerCompany/detail/${companyId}`);
//根据公司id查询股权信息
export const selectByCompanyId = companyId => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerCompany/selectByCompanyId/${companyId}`)
//根据公司id查询附件信息
export const selectFileByCompanyId = companyId => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerCompany/selectFileByCompanyId/${companyId}`)
/**
 * 插入经销商公司
 * @param params
 * @returns {*}
 */
export const insertDealerCompany = params => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/dealerCompany`, params);

/**
 * 修改经销商公司
 * @param id
 * @param params
 * @returns {*}
 */
export const updateDealerCompany = (companyId, params) => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/dealerCompany/${companyId}`, params);

/**
 * 公司信息维护首页导出
 */
export const getClaimListForExport = (params) => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/dealerCompany/getListForExport`, params,{
  responseType: 'blob'
});


/**
 * 员工信息维护首页导出
 */
 export const getClaimListForExport1 = (params) => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/personnelInfo/dealerStation/getListForExport`, params,{
  responseType: 'blob'
});

/**
 * 重置管理员密码
 */
 export const updateResetPasswords = (companyCode) => axios.get(`${SERVER.midEndAuthCenter}/resetPassword/${companyCode}`);
